package com.zxy.springboot_vue.service.impl;

import com.zxy.springboot_vue.entity.Menu;
import com.zxy.springboot_vue.mapper.MenuMapper;
import com.zxy.springboot_vue.service.IMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lenovo
 * @since 2021-10-19
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService {

    @Autowired
    private MenuMapper menuMapper;

    @Override
    public List<Menu> selectAll(int parentId) {
        List<Menu> menus = menuMapper.selectAll(parentId);
        return menus;
    }

    @Override
    public List<Menu> findMenusByUid(Integer uid, Integer parentId) {
        List<Menu> menus = menuMapper.findMenusByUid(uid,parentId);
        return menus;
    }
}
